using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DevExpress.ExpressApp.DC;
using DevExpress.Persistent.Base;
using DevExpress.Persistent.BaseImpl;
using DevExpress.Xpo;
using DevExpress.Persistent.Validation;
namespace Ascent.QiPei.Module.BusinessObjects.Base
{
  [DefaultClassOptions]
  [DevExpress.Persistent.Base.NavigationItemAttribute("基础数据")]
  [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("员工")]
  [DevExpress.Persistent.Base.ImageNameAttribute("BO_Employee")]
  public partial class Employee : DevExpress.Persistent.BaseImpl.BaseObject
  {
    private Ascent.QiPei.Module.BusinessObjects.Inventory.InventoryVerification _inventoryVerification;
    private Ascent.QiPei.Module.BusinessObjects.Inventory.InventoryAdjustment _inventoryAdjustment;
    private Ascent.QiPei.Module.BusinessObjects.Inventory.InventoryTransfer _inventoryTransfer;
    private Ascent.QiPei.Module.BusinessObjects.Enums.PositionType _position;
    private Ascent.QiPei.Module.BusinessObjects.Sales.SaleOrder _saleOrder;
    private Ascent.QiPei.Module.BusinessObjects.Systems.ShopStore _shopStore;
    private System.Boolean _isActive;
    private System.String _remarks;
    private System.String _eMAIL;
    private System.String _telephone;
    private System.String _mobile;
    private System.String _iDCard;
    private System.DateTime _datesEmployed;
    private Ascent.QiPei.Module.BusinessObjects.Enums.SexType _sex;
    private System.String _name;
    public Employee(DevExpress.Xpo.Session session)
      : base(session)
    {
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("姓名")]
    [RuleRequiredField(DefaultContexts.Save)]
    public System.String Name
    {
      get
      {
        return _name;
      }
      set
      {
        SetPropertyValue("Name", ref _name, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("性别")]
    [RuleRequiredField(DefaultContexts.Save)]
    public Ascent.QiPei.Module.BusinessObjects.Enums.SexType Sex
    {
      get
      {
        return _sex;
      }
      set
      {
        SetPropertyValue("Sex", ref _sex, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("职位")]
    [RuleRequiredField(DefaultContexts.Save)]
    public Ascent.QiPei.Module.BusinessObjects.Enums.PositionType Position
    {
      get
      {
        return _position;
      }
      set
      {
        SetPropertyValue("Position", ref _position, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("入职日期")]
    public System.DateTime DatesEmployed
    {
      get
      {
        return _datesEmployed;
      }
      set
      {
        SetPropertyValue("DatesEmployed", ref _datesEmployed, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("身份证号")]
    [DevExpress.Persistent.Base.VisibleInLookupListViewAttribute(false)]
    [DevExpress.Persistent.Base.VisibleInListViewAttribute(false)]
    public System.String IDCard
    {
      get
      {
        return _iDCard;
      }
      set
      {
        SetPropertyValue("IDCard", ref _iDCard, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("手机")]
    public System.String Mobile
    {
      get
      {
        return _mobile;
      }
      set
      {
        SetPropertyValue("Mobile", ref _mobile, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("电话")]
    public System.String Telephone
    {
      get
      {
        return _telephone;
      }
      set
      {
        SetPropertyValue("Telephone", ref _telephone, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("邮箱")]
    public System.String EMAIL
    {
      get
      {
        return _eMAIL;
      }
      set
      {
        SetPropertyValue("EMAIL", ref _eMAIL, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("备注")]
    [DevExpress.Persistent.Base.VisibleInListViewAttribute(false)]
    [DevExpress.Persistent.Base.VisibleInLookupListViewAttribute(false)]
    public System.String Remarks
    {
      get
      {
        return _remarks;
      }
      set
      {
        SetPropertyValue("Remarks", ref _remarks, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("是否可用")]
    [DevExpress.Persistent.Base.VisibleInLookupListViewAttribute(false)]
    [DevExpress.Persistent.Base.VisibleInListViewAttribute(false)]
    public System.Boolean IsActive
    {
      get
      {
        return _isActive;
      }
      set
      {
        SetPropertyValue("IsActive", ref _isActive, value);
      }
    }
    [DevExpress.Xpo.AssociationAttribute("Employees-ShopStore")]
    [System.ComponentModel.BrowsableAttribute(false)]
    public Ascent.QiPei.Module.BusinessObjects.Systems.ShopStore ShopStore
    {
      get
      {
        return _shopStore;
      }
      set
      {
        SetPropertyValue("ShopStore", ref _shopStore, value);
      }
    }
    [System.ComponentModel.BrowsableAttribute(false)]
    public Ascent.QiPei.Module.BusinessObjects.Sales.SaleOrder SaleOrder
    {
      get
      {
        return _saleOrder;
      }
      set
      {
        if (_saleOrder == value)
          return;
        Ascent.QiPei.Module.BusinessObjects.Sales.SaleOrder prevSaleOrder = _saleOrder;
        _saleOrder = value;
        if (IsLoading)
          return;
        if (prevSaleOrder != null && prevSaleOrder.Employee == this)
          prevSaleOrder.Employee = null;
        if (_saleOrder != null)
          _saleOrder.Employee = this;
        OnChanged("SaleOrder");
      }
    }
    [System.ComponentModel.BrowsableAttribute(false)]
    public Ascent.QiPei.Module.BusinessObjects.Inventory.InventoryTransfer InventoryTransfer
    {
      get
      {
        return _inventoryTransfer;
      }
      set
      {
        if (_inventoryTransfer == value)
          return;
        Ascent.QiPei.Module.BusinessObjects.Inventory.InventoryTransfer prevInventoryTransfer = _inventoryTransfer;
        _inventoryTransfer = value;
        if (IsLoading)
          return;
        if (prevInventoryTransfer != null && prevInventoryTransfer.Employee == this)
          prevInventoryTransfer.Employee = null;
        if (_inventoryTransfer != null)
          _inventoryTransfer.Employee = this;
        OnChanged("InventoryTransfer");
      }
    }
    [System.ComponentModel.BrowsableAttribute(false)]
    public Ascent.QiPei.Module.BusinessObjects.Inventory.InventoryAdjustment InventoryAdjustment
    {
      get
      {
        return _inventoryAdjustment;
      }
      set
      {
        if (_inventoryAdjustment == value)
          return;
        Ascent.QiPei.Module.BusinessObjects.Inventory.InventoryAdjustment prevInventoryAdjustment = _inventoryAdjustment;
        _inventoryAdjustment = value;
        if (IsLoading)
          return;
        if (prevInventoryAdjustment != null && prevInventoryAdjustment.Employee == this)
          prevInventoryAdjustment.Employee = null;
        if (_inventoryAdjustment != null)
          _inventoryAdjustment.Employee = this;
        OnChanged("InventoryAdjustment");
      }
    }
    [System.ComponentModel.BrowsableAttribute(false)]
    public Ascent.QiPei.Module.BusinessObjects.Inventory.InventoryVerification InventoryVerification
    {
      get
      {
        return _inventoryVerification;
      }
      set
      {
        if (_inventoryVerification == value)
          return;
        Ascent.QiPei.Module.BusinessObjects.Inventory.InventoryVerification prevInventoryVerification = _inventoryVerification;
        _inventoryVerification = value;
        if (IsLoading)
          return;
        if (prevInventoryVerification != null && prevInventoryVerification.UpdateUser == this)
          prevInventoryVerification.UpdateUser = null;
        if (_inventoryVerification != null)
          _inventoryVerification.UpdateUser = this;
        OnChanged("InventoryVerification");
      }
    }
  }
}
